package com.xbongbong.saas.script.tempenum;

import com.xbongbong.paas.enums.DateTimeEnum;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.ItemPoJo;
import com.xbongbong.saas.enums.business.PersonalCustomerEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/6/15 14:41
 * @since v1.0
 */
@Getter
public enum TempPersonalCustomerEnum {

    /**
     *
     */
    GENDER(PersonalCustomerEnum.GENDER),

    BIRTHDAY(PersonalCustomerEnum.BIRTHDAY),

    QQ(PersonalCustomerEnum.QQ),

    WECHAT(PersonalCustomerEnum.WECHAT),

    HOBBY(PersonalCustomerEnum.HOBBY),

    IMAGE(PersonalCustomerEnum.IMAGE),

    FILE(PersonalCustomerEnum.FILE),

    MEMO(PersonalCustomerEnum.MEMO),
    ;
    private PersonalCustomerEnum anEnum;

    TempPersonalCustomerEnum(PersonalCustomerEnum anEnum) {
        this.anEnum = anEnum;
    }

    public static List<TempPersonalCustomerEnum> getAllEnum() {
        List<TempPersonalCustomerEnum> list = new ArrayList<>();
        Collections.addAll(list, values());
        return list;
    }

    public static void initGender(FieldAttrEntity fieldAttrEntity) {
        List<ItemPoJo> itemList = new ArrayList<>();
        String[] genderArray = {"男", "女"};
        for (int i = 0; i < genderArray.length; i++) {
            ItemPoJo itemPoJo = new ItemPoJo();
            itemPoJo.setText(genderArray[i]);
            itemPoJo.setValue(String.valueOf(i));
            itemList.add(itemPoJo);
        }
        fieldAttrEntity.setIsRedundant(1);
        fieldAttrEntity.setItems(itemList);
    }

    public static void initBirthday(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setDateType(DateTimeEnum.TIME.getType());
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initQq(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initWeChat(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initHobby(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initImage(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initFile(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }

    public static void initMemo(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setIsRedundant(1);
    }


}
